<template>
  <div>
    <el-table
      :data="this.tableData"
      style="width: 100%"
      :default-sort="{prop: 'date', order: 'descending'}"
    >
      <el-table-column prop="id" label="种类" sortable width="100"></el-table-column>
      <el-table-column prop="user_phone" label="供应企业" sortable width="110"></el-table-column>
      <el-table-column prop="gydz" label="供应地址" sortable width="200"></el-table-column>
      <el-table-column prop="cpgg" label="产品规格" sortable width="200"></el-table-column>
      <el-table-column label="图片">
        <template slot-scope="scope">
          <img :src="scope.row.hyd_img" style="height: 50px" />
        </template>
      </el-table-column>
      <el-table-column prop="frl" sortable label="发热量" width="100"></el-table-column>
      <el-table-column prop="gdt" sortable label="固定碳" width="100"></el-table-column>
      <el-table-column prop="liu" sortable label="硫" width="100"></el-table-column>
      <el-table-column prop="huifa" sortable label="挥发" width="100"></el-table-column>
      <el-table-column prop="shuifen" sortable label="水分" width="100"></el-table-column>
      <el-table-column prop="huifen" sortable label="灰分" width="100"></el-table-column>
      <el-table-column prop="title" sortable label="标题" width="100"></el-table-column>
      <el-table-column label="产品图片">
        <template slot-scope="scope">
          <img :src="scope.row.cp_img" style="height: 50px" />
        </template>
      </el-table-column>
      <el-table-column prop="cp_video" sortable label="产品视频连接" width="350"></el-table-column>
      <el-table-column prop="kc" sortable label="库存" width="100"></el-table-column>
      <el-table-column prop="price" sortable label="价格" width="100"></el-table-column>
      <el-table-column prop="cpjs" sortable label="产品介绍" width="550"></el-table-column>
      <el-table-column prop="qyjs" sortable label="企业介绍" width="650"></el-table-column>
      <el-table-column label="企业图片">
        <template slot-scope="scope">
          <img :src="scope.row.qiye_img" style="height: 50px" />
        </template>
      </el-table-column>
      <el-table-column label="营业执照">
        <template slot-scope="scope">
          <img :src="scope.row.yyzz_img" style="height: 50px" />
        </template>
      </el-table-column>
      <el-table-column prop="xydm" sortable label="信用代码" width="100"></el-table-column>
      <el-table-column prop="company_name" sortable label="公司名称" width="100"></el-table-column>
      <el-table-column prop="fddbr" sortable label="法定代表人" width="100"></el-table-column>
      <el-table-column prop="zhusuo" sortable label="住所" width="100"></el-table-column>
      <el-table-column prop="nsmc" sortable label="纳税名称" width="100"></el-table-column>
      <el-table-column prop="nsyh" sortable label="纳税银行" width="100"></el-table-column>
      <el-table-column prop="khzh" sortable label="开户帐号" width="100"></el-table-column>
      <el-table-column prop="nsdz" sortable label="纳税地址" width="100"></el-table-column>
      <el-table-column prop="nsdh" sortable label="纳税电话" width="100"></el-table-column>
      <el-table-column prop="created_at" sortable label="创建时间" width="100"></el-table-column>
      <el-table-column prop="updated_at" sortable label="更新时间" width="100"></el-table-column>
      <el-table-column prop="deleted_at" sortable label="删除时间" width="100"></el-table-column>
      <el-table-column label="操作" width="200">
        <template slot-scope="scope">
          <el-button
            type="text"
            size="small"
            @click.native.prevent="deleteRow(scope.$index, tableData)"
          >删除</el-button>
          <el-button type="text" size="small" @click="toDetails(scope.$index, scope.row)">详情</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
export default {
  data() {
    return {
      tableData: [],
      id: 0
    };
  },

  created() {
    this.id = this.$route.query.product_id;
    console.log(this.id);
    this.axios({
      method: "post",
      url: "/wrd/jm_xq",
      params: {
        product_id: this.id
      }
    }).then(res => {
      console.log(res);
      this.tableData.push(res.data.data);
      // console.log(this.tableData);
    });
  },
  mounted() {
    console.log(this.tableData);
  },
  methods: {
    handleClick(row) {
      console.log(row);
    },
    deleteRow(index, rows) {
      rows.splice(index, 1);
    }
    // getUsers() {
    //   this.isShowloading = true;
    //   let params = {
    //     searchInfo: this.searchInfo.trim(),
    //     page: this.pageNo
    //   };
    // }
  }
};
</script>
<style  scoped>
</style>